package com.hk.utils;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

/**
 * @Author: aerfazhe
 * @Date: 2021/6/30 15:22
 * @Statement: redis连接工具类
 */
public class JedisUtil {

    /*private static String REDIS_URL = "192.168.1.3";
    private static String REDIS_URL1 = "127.0.0.1";
    private static Integer REDIS_PORT = 6379;*/

    public static Jedis getJedis() {
        JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
        JedisPool jedisPool = new JedisPool(jedisPoolConfig,RedisEnum.REDIS_URL.getValue(),RedisEnum.REDIS_PORT.getPort());
        Jedis jedis = jedisPool.getResource();
        return jedis;
    }

}
